package cn.bandeqing.payRecord.entity;

import cn.bandeqing.frame.mybatis.config.InsertOrUpdateListener;
import cn.bandeqing.frame.mybatis.entity.BaseEntity;
import cn.bandeqing.order.req.OrderDouyinVerifyReq;
import cn.bandeqing.order.req.OrderModifyStatusReq;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * 支付记录 实体类。
 *
 * @author fugui
 * @since 2024-02-09
 */
@EqualsAndHashCode(callSuper = true)
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "bdq_pay_record", onInsert = InsertOrUpdateListener.class, onUpdate = InsertOrUpdateListener.class)
@AutoMappers({
        @AutoMapper(target = OrderModifyStatusReq.class, convertGenerate = false),
        @AutoMapper(target = OrderDouyinVerifyReq.class, convertGenerate = false)
})
public class PayRecord extends BaseEntity {

    @Id(keyType = KeyType.Auto)
    private Long payId;

    private Long orderId;

    private Double payMoney;

    /**
     * 支付类型 0=订单定金 1=订单尾款
     */
    private PayType payType;

    /**
     * 支付来源 0=抖音券 1=微信支付
     */
    private PaySource paySource;

    private String payRemark;

    private Double payAfterDeposit;
    private Double payBeforeDeposit;
    private Double payAfterFinalPayment;
    private Double payBeforeFinalPayment;
    private Double payAfterTotalPrice;
    private Double payBeforeTotalPrice;

    // 120228683268162
    private String douyinCode;
    private DouyinCodeStatus douyinCodeStatus;

//    pay_after_deposit	decimal	10	2	True	False	False	0									0	False	False	False	False	False	False
//    pay_before_deposit	decimal	10	2	True	False	False	0									0	False	False	False	False	False	False
//    pay_after_final_payment	decimal	10	2	True	False	False	0									0	False	False	False	False	False	False
//    pay_before_final_payment	decimal	10	2	True	False	False	0									0	False	False	False	False	False	False
//    pay_after_total_price	decimal	10	2	True	False	False	0									0	False	False	False	False	False	False
//    pay_before_total_price	decimal	10	2	True	False	False	0									0	False	False	False	False	False	False


}
